#include <iostream>
#include <iomanip>
using namespace std;
void I(int count)
{
    int sum = 0;
    int *p;
    int *a = new int[count];
    p = a;
    for (int i = 0; i < count; i++)
    {
        cin >> *p;
        p++;
        /* code */
    }
    p = a;
    for (int i = 0; i < count; i++)
    {
        sum += *p;
        p++;
        /* code */
    }
    cout << sum / count << endl;
}

void C(int count)
{
    char sum = 0;
    char *p;
    char *a = new char[count];
    p = a;
    for (int i = 0; i < count; i++)
    {
        cin >> *p;
        p++;
        /* code */
    }
    p = a;
    sum = *a;
    for (int i = 0; i < count; i++)
    {
        if (sum < *p)
        {
            sum = *p;
        }
        p++;
        /* code */
    }
    cout << sum << endl;
}

void F(int count)
{
    double sum = 0;
    double *p;
    double *a = new double[count];
    p = a;
    for (int i = 0; i < count; i++)
    {
        cin >> *p;
        p++;
        /* code */
    }
    p = a;
    sum = *a;
    for (int i = 0; i < count; i++)
    {
        if (sum > *p)
        {
            sum = *p;
        }
        p++;
        /* code */
    }
    cout << fixed << setprecision(1) << sum << endl;
}

int main()
{
    int t, n;
    char a;
    cin >> t;
    for (int i = 0; i < t; i++)
    {
        cin >> a;
        cin >> n;
        // cout << a << n;
        if (a == 'I')
        {
            I(n);
        }
        else if (a == 'C')
        {
            C(n);
        }
        else if (a == 'F')
        {
            F(n);
        }
        /* code */
    }

    return 0;
}
